This patch fixes xenlinux timer interrupt.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sat, 10 Sep 2005 14:22:12 +0000 (14:22 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sat, 10 Sep 2005 14:22:12 +0000 (14:22 +0000)
In xenlinux timer interrupt variable cpu is sometimes uesd in a for
loop, but later it is used to access per cpu data i.e.
per_cpu(processed_system_time, cpu), which causes an invalid pointer.

Signed-off-by: Xin Li <xin.b.li@intel.com>
linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c

index 7f5454e1ee7a4bf04de46a95be0e40086b880ff4..1de1bb89c0405a6501bab912dde5bb3e45d217fd 100644 (file)
@@ -543,7 +543,7 @@ EXPORT_SYMBOL(profile_pc);
 irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
        s64 delta, delta_cpu;
-       int cpu = smp_processor_id();
+       int i, cpu = smp_processor_id();
        struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
 
        write_seqlock(&xtime_lock);
@@ -566,9 +566,9 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                       (s64)get_nsec_offset(shadow),
                       processed_system_time,
                       per_cpu(processed_system_time, cpu));
-               for (cpu = 0; cpu < num_online_cpus(); cpu++)
-                       printk(" %d: %lld\n", cpu,
-                              per_cpu(processed_system_time, cpu));
+               for (i = 0; i < num_online_cpus(); i++)
+                       printk(" %d: %lld\n", i,
+                              per_cpu(processed_system_time, i));
        }
 
        /* System-wide jiffy work. */